package org.nanhill.support.jmx.dwjmxservice;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class ClickMeterFrame extends JFrame {
	/**
	 * 
	 */
	private static final long serialVersionUID = 8168899048850464884L;

	JPanel contentPane;

	public ClickPanel clickPanel;

	BorderLayout borderLayout = new BorderLayout();

	public ClickMeterFrame() {
		enableEvents(AWTEvent.WINDOW_EVENT_MASK);
		try {
			guiInit();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	private void guiInit() throws Exception {
		contentPane = (JPanel) this.getContentPane();
		contentPane.setLayout(borderLayout);
		this.setSize(new Dimension(400, 300));
		this.setTitle("dW Click Meter");
		clickPanel = new ClickPanel();
		clickPanel.initController();
		contentPane.add(clickPanel, BorderLayout.NORTH);
	}

	protected void processWindowEvent(WindowEvent e) {
		super.processWindowEvent(e);
		if (e.getID() == WindowEvent.WINDOW_CLOSING) {
			System.exit(0);
		}
	}

}